-
Notifications
You must be signed in to change notification settings - Fork 14
chore(KNO-11486): exclude metadata when refetching feed after new message received #853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(KNO-11486): exclude metadata when refetching feed after new message received #853
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: b67f436 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@cursor review |
|
@cursor review |
db04746 to
2af3f5e
Compare
f71b7c7 to
b67f436
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "inserted_at.gte"?: string; | ||
| "inserted_at.lte"?: string; | ||
| "inserted_at.gt"?: string; | ||
| "inserted_at.lt"?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FeedResponse.meta type not updated to allow undefined
Medium Severity
The FeedResponse interface still defines meta: FeedMetadata as required, but when a socket-triggered fetch sends exclude: "meta", result.body.meta will be undefined at runtime. This response object is broadcast to messages.new legacy event listeners via FeedRealTimeCallback, whose type promises meta is always FeedMetadata. Consumers accessing resp.meta.total_count would get a TypeError. The FeedEventPayload.metadata type was correctly updated to optional, but FeedResponse.meta was not.
Additional Locations (1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| items: response.entries as FeedItem[], | ||
| metadata: response.meta as FeedMetadata, | ||
| // meta will not be present on the response when __fetchSource is "socket" | ||
| metadata: response.meta as FeedMetadata | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FeedResponse.meta type not updated to reflect optional
Medium Severity
The FeedResponse interface still defines meta: FeedMetadata as required, but after this change, meta can be undefined at runtime when exclude includes "meta" (which now happens automatically for socket-triggered fetches). The cast to FeedMetadata | undefined and the meta ?? state.metadata fallback are runtime workarounds, but the FeedResponse type itself was not updated. Since FeedResponse is a public export used by FeedRealTimeCallback, consumers of the legacy "messages.new" event who access resp.meta.total_count (or similar) will encounter a runtime crash when the fetch is socket-triggered — and TypeScript won't warn them because the type says meta is always present.
Additional Locations (1)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #853 +/- ##
==========================================
+ Coverage 68.45% 68.58% +0.12%
==========================================
Files 193 193
Lines 8062 8088 +26
Branches 1065 1076 +11
==========================================
+ Hits 5519 5547 +28
+ Misses 2518 2516 -2
Partials 25 25
|



Description
This PR updates the client SDK so that:
excludeoption, used to exclude specified fields from the list feed items response payload"new-message"is received, the request we make to the list feed items endpoint automatically excludes themetafield from its response.metacontains the badge counts, which are already present on the socket event payload, so querying formetais redundant.Todos
Checklist
Loom demo
https://www.loom.com/share/56c2bb427c31485ea8b837c3c416be04